package nl.weeaboo.sh.level1;

import nl.weeaboo.game.gl.GLImage;
import nl.weeaboo.game.input.UserInput;
import nl.weeaboo.sh.Game;
import nl.weeaboo.sh.danmaku.SpellUtil;
import nl.weeaboo.sh.level.Level;
import nl.weeaboo.sh.objects.Platform;

public class Chandelier extends Platform {

	private float a = 256;
	private float da = .5f;
	
	public Chandelier(Game game, Level level, GLImage image) {
		super(game, level, image);
	}
	
	//Functions
	public void update(UserInput input, float dt) {		
		if (a < 192) da = -da;
		if (a > 320) da = -da;

		a += da;
		
		int tx = 400 + Math.round( 200 * SpellUtil.fastSin(a));
		int ty = 200 + Math.round(-100 * SpellUtil.fastCos(a));
		
		setSpeed(tx-x, ty-y);
		
		super.update(input, dt);
	}

	//Getters

	//Setters
	
}
